#include "Cfps.h"


Cfps::Cfps()
{
fps=60;
time0=SDL_GetTicks();
}

Cfps::Cfps(int framespersecond)
{
fps=framespersecond;
}


Cfps::~Cfps()
{
}

void Cfps::regulatefps()
{

	int difference=SDL_GetTicks()-time0;
	

	if(difference<(1000/fps))
	{
		SDL_Delay(((1000/fps) - difference));
	}
	time0=SDL_GetTicks();
}

